﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Multiprocessing.Core.Algorithm;

namespace Multiprocessing.Analyse
{
    public abstract class BaseAnalyseUnit : IAnalyseUnit
    {
        #region Fields

        private readonly IAlgorithm _algorithm;

        #endregion

        #region Properties

        public IAlgorithm Algorithm
        {
            get { return _algorithm; }
        }

        #endregion

        #region Constructors

        protected BaseAnalyseUnit(IAlgorithm algorithm)
        {
            if (ReferenceEquals(algorithm, null))
            {
                throw new ArgumentNullException("algorithm");
            }
            _algorithm = algorithm;
        }

        #endregion

        #region Methods

        public abstract double Calculate(int processingUnitCount, params object[] args);

        public abstract double Calculate(int processingUnitCount, Type processingBlockType, out TimeSpan elapsed, params object[] args);

        #endregion
    }
}
